Skip to content

systeminformation thread not ending: move error handling from utils to app#4160

Merged
KristjanESPERANTO merged 2 commits into
MagicMirrorOrg:developfrom
khassel:sysinfo
May 19, 2026
Merged

systeminformation thread not ending: move error handling from utils to app#4160
KristjanESPERANTO merged 2 commits into
MagicMirrorOrg:developfrom
khassel:sysinfo

Conversation

@khassel
Copy link
Copy Markdown
Collaborator

@khassel khassel commented May 18, 2026

This reverts #4155 because that didn't work when running under electron (process.on("exit",...) is not called).

This approach puts a try/catch around the start function in app.js and in utils.js the process.exit(1) calls are replaced with throw new Error("process.exit:1");. The error message process.exit:1 is not evaluated in app.js but needed in the tests.

The short delay is now implemented in the catch block so the systeminformation is displayed.

Copy link
Copy Markdown
Collaborator

@KristjanESPERANTO KristjanESPERANTO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! One additional thought: would it make sense to introduce a small dedicated error class (e.g. ConfigError) instead of matching on the "process.exit:1" message string? That might make the intent a bit clearer. No strong opinion though - could also just as well be a follow-up PR.

Comment thread js/app.js
Comment thread js/utils.js Fixed
@khassel khassel requested a review from KristjanESPERANTO May 19, 2026 21:33
@KristjanESPERANTO KristjanESPERANTO merged commit 7abbe62 into MagicMirrorOrg:develop May 19, 2026
12 checks passed
@khassel khassel deleted the sysinfo branch May 19, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants